package com.edais.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import com.edais.domain.Prize;
import com.edais.domain.PrizeHistory;
import com.edais.domain.RateRisesCoupons;
import com.edais.persistence.QuanHouPrizeMapper;
import com.edais.persistence.RateRisesCouponsMapper;


@Repository

public class QuanHouPrizeDao {
	@Autowired
	private QuanHouPrizeMapper quanHouPrizeMapper;
	
	@Autowired
	private RateRisesCouponsMapper rateRisesCouponsMapper;
	
	
	/**
	 * 根据参数查询我的兑奖信息列表
	 * @param paramsMap
	 * @return
	 */
	public Prize queryQuanHouPrizeListByMobile(Map<String,Object> paramsMap){
		return quanHouPrizeMapper.queryQuanHouPrizeListByMobile(paramsMap);
	}
	
	/**
	 * 根据参数查询我的兑奖状态
	 * @param paramsMap
	 */
	public int selHisCountByMobile(Map<String, Object> paramsMap) {
		return this.quanHouPrizeMapper.selHisCountByMobile(paramsMap);
	}
	
	/**
	 * 查询兑奖手机号次数
	 * @param putMobile
	 */
	public int selMaxCountByMobile(String putMobile) {
		return this.quanHouPrizeMapper.selMaxCountByMobile(putMobile);
	}
	
	/**
	 * 根据参数查询限制次数
	 * @param paramsMap
	 */
	public int selLimitCount(Map<String, Object> updMap) {
		return this.quanHouPrizeMapper.selLimitCount(updMap);
	}
	
	/**
	 * 根据参数更新我的兑奖状态
	 * @param uptInstm
	 * @return
	 */
	public void uptQuanHouPrizeList(String uptInstm) {
		this.quanHouPrizeMapper.uptQuanHouPrizeList(uptInstm);
	}
	

	/**
	 * 获取加息券
	 * @param rateRisesCoupons
	 * @return
	 */
	public void insertRateRisesCoupons(RateRisesCoupons rateRisesCoupons){
		this.quanHouPrizeMapper.insertRateRisesCoupons(rateRisesCoupons);
	}

	/**
	 * 存储兑奖历史
	 * @param rateRisesCoupons
	 * @return
	 */
	public void insertPrizeHistory(PrizeHistory przHty){
		this.quanHouPrizeMapper.insertPrizeHistory(przHty);
	}

	/**
	 * 查询有效期
	 * @param listStr
	 * @return
	 */
	public List<Map<String, Object>> queryParamName(List<String> listStr) {
		return rateRisesCouponsMapper.queryParamName(listStr);
	}
	
}
